package com.woniuxy.microorderserver.controller;

import com.github.pagehelper.PageInfo;
import com.woniuxy.microcommonserver.bean.order_caize.ExpressInfo;
import com.woniuxy.microcommonserver.bean.order_caize.OrderInfo;
import com.woniuxy.microcommonserver.pageHelper.PageRequest;
import com.woniuxy.microcommonserver.pageHelper.TableResult;
import com.woniuxy.microorderserver.service.IExpressService;
import com.woniuxy.microorderserver.service.IOrderService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/express")
public class ExpressController {
    @Resource
    private IExpressService expressServiceImpl;
    /**
     * 分页查看全部快递单
     */
    @RequestMapping(value = "/all",produces = {"application/json;charset=utf-8"})
    public TableResult<ExpressInfo> findAllExpress(PageRequest request){
        PageInfo<ExpressInfo> pageInfo =  expressServiceImpl.findAllExpress(request);

        return new TableResult(pageInfo.getTotal(),pageInfo.getList());
    }
}
